package com.yx.cloud.activity;

import android.content.Intent;
import android.view.View;

import com.iot.base.service.req.FeedBackParam;
import com.yx.cloud.R;
import com.yx.cloud.base.BaseActivity;
import com.yx.cloud.databinding.HelpfeedbackmessageActivityBinding;
import com.yx.cloud.utils.Intent_utils;
import com.yx.cloud.utils.RomUtils;

/**
 * 反馈信息界面
 */
public class HelpFeedbackMessageActivity extends BaseActivity implements View.OnClickListener {
    private String extra;
    private int hdType;
    private HelpfeedbackmessageActivityBinding binding;

    @Override
    public void onCreate() {
        binding = HelpfeedbackmessageActivityBinding.inflate(getLayoutInflater());
        setContentView(binding.getRoot());
        initData();
    }

    private void initData() {

        extra = getIntent().getStringExtra("help");
        binding.tvHelpTitle.setText(extra + "");
        if (extra.equals("APP")) {
            hdType= FeedBackParam.TYPE_APP;
            binding.llApphelp.setVisibility(View.VISIBLE);
            binding.llEquipmenthelp.setVisibility(View.GONE);
        } else {
            hdType= FeedBackParam.TYPE_DEVICE;
            binding.llApphelp.setVisibility(View.GONE);
            binding.llEquipmenthelp.setVisibility(View.VISIBLE);
        }

        binding.ivFeedbackReturn.setOnClickListener(this);
        binding.btnFeedbackIssue.setOnClickListener(this);
        binding.rlApp1.setOnClickListener(this);
        binding.rlApp2.setOnClickListener(this);
        binding.rlApp3.setOnClickListener(this);
        binding.rlApp4.setOnClickListener(this);
        binding.rlApp5.setOnClickListener(this);
        binding.rlApp6.setOnClickListener(this);
        binding.rlApp7.setOnClickListener(this);
        binding.rlApp8.setOnClickListener(this);
        binding.rlEquipment1.setOnClickListener(this);
        binding.rlEquipment2.setOnClickListener(this);
        binding.rlEquipment3.setOnClickListener(this);
        binding.rlEquipment4.setOnClickListener(this);
        binding.rlEquipment5.setOnClickListener(this);
        binding.rlEquipment6.setOnClickListener(this);
        binding.rlEquipment7.setOnClickListener(this);
        binding.rlEquipment8.setOnClickListener(this);
    }

    @Override
    public void onClick(View v) {
        if (RomUtils.isFastClick()) {
            return;
        }
        int id = v.getId();
        if (id == R.id.iv_feedbackReturn) {
            Intent_utils.backIntent(this);
        } else if (id == R.id.btn_feedbackIssue) {
            Intent intent = new Intent(this, FeedbackMessageActivity.class);
//            intent.putExtra("hdid", "");
            intent.putExtra("hdType", hdType);
            startActivity(intent);
        } else if (id == R.id.rl_app1) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app1");
        } else if (id == R.id.rl_app2) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app2");
        } else if (id == R.id.rl_app3) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app3");
        } else if (id == R.id.rl_app4) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app4");
        } else if (id == R.id.rl_app5) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app5");
        } else if (id == R.id.rl_app6) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app6");
        } else if (id == R.id.rl_app7) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app7");
        } else if (id == R.id.rl_app8) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_app8");
        } else if (id == R.id.rl_equipment1) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment1");
        } else if (id == R.id.rl_equipment2) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment2");
        } else if (id == R.id.rl_equipment3) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment3");
        } else if (id == R.id.rl_equipment4) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment4");
        } else if (id == R.id.rl_equipment5) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment5");
        } else if (id == R.id.rl_equipment6) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment6");
        } else if (id == R.id.rl_equipment7) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment7");
        } else if (id == R.id.rl_equipment8) {
            Intent_utils.enterIntentContext(this, HelpMessageActivity.class, "hdType", "rl_equipment8");
        }
    }
}
